import main_menu from '../../../main_menu'
import wx from 'weixin-js-sdk';
var that
export default {
    data () {
        return this.datainit({
            list: [],
            sublist: [],
            user:{
                group_code:null
            },
            first_id:null
        })
    },
    components: {main_menu},
    mounted: function () {
        let id = this.$route.query.id
        that = this
        that.check()
        this.$post("api/cate/lists", null, function (list) {
            that.list = list
            that.first_id=list[0].id
            if(id!=null){
                that.first_id=id
            }
            that.setsublist()
        })
    },

    methods:{
        user_init: function (_user) {
            that.user = _user
        },
        setsublist:function () {
            this.$post("api/cate/lists", {up_id:that.first_id}, function (list) {
                that.sublist = list
            })
        },
        set_first_id(id){
            that.first_id=id
            that.setsublist()
        }
    }


}